<template>
	<view>
		<input style="border: 1rpx solid #000000;" @input="debouncedSearchHandler" type="text" class="input" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				txt: '',
				debouncedSearchHandler: null,
			}
		},
		created() {
			this.debouncedSearchHandler = this.debounce(this.submit,1000, true)
		},
		methods: {
			submit() {
				console.log(123456)
			},
			debounce(func, wait) {
			  let timeout;
			  return function(...args) {
			    const context = this;
			    clearTimeout(timeout);
			    timeout = setTimeout(() => func.apply(context, args), wait);
			  };
			}
		}
	}
</script>

<style>

</style>
